package com.example.yunbiji0314.dao;

import com.example.yunbiji0314.pojo.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.SelectKey;

public interface OrderDao {

    // 订单添加成功后，获取订单表的主键
    @SelectKey(keyProperty = "id", resultType = Integer.class, before = false, statement = "select last_insert_id()")
    // 添加订单
    @Insert("insert into orders(uid,money) values(#{uid},#{money})")
    public int addOrder(Order order);
}
